package site.timers.game;

public abstract class Skill {
    protected String name;
    protected int cooldown;
    protected int currentCooldown;
    protected int range;
    protected int cost;

    public Skill(String name, int cooldown, int range, int cost) {
        this.name = name;
        this.cooldown = cooldown;
        this.range = range;
        this.cost = cost;
        this.currentCooldown = 0;
    }

    public abstract void execute(Character caster, Character target);

    public boolean isReady() {
        return currentCooldown == 0;
    }

    public void updateCooldown() {
        if (currentCooldown > 0) {
            currentCooldown--;
        }
    }

    // Getters
    public String getName() { return name; }
    public int getRange() { return range; }
    public int getCost() { return cost; }
    public int getCurrentCooldown() { return currentCooldown; }
}